<template>
  <div class="bg-all">
    <TabBar></TabBar>
    <Swiper  :images="images"></Swiper>
    <SubNav></SubNav>
    <ThreeMaps></ThreeMaps>
    <TitleColumn></TitleColumn>
    <ProductList></ProductList>
  </div>
</template>

<script>
import card from '@/components/card'
import Swiper from '../components/swiper'
import SubNav from '../components/sub-nav'
import ThreeMaps from '../components/three-maps'
import TitleColumn from '../components/title-column'
import ProductList from '../components/product-list'
import TabBar from '../components/tabBar'
import ShoppingCart from '../pages/shoppingcart/shoppingcart'
export default {
  mpType: 'page',
  data () {
    return {
      motto: 'Hello World',
      userInfo: {},
      images: [
        {
          url:
            'http://static.resource.youyu.weijuju.com//image/page/index/banner/2017/banner_voice_vote.jpg?v=7'
        },
        {
          url:
            'http://static.resource.youyu.weijuju.com//image/page/index/banner/2017/banner_voice_vote.jpg?v=7'
        }
      ]
    }
  },

  components: {
    TabBar,
    ProductList,
    TitleColumn,
    ThreeMaps,
    SubNav,
    Swiper,
    card,
    ShoppingCart
  },

  methods: {
    bindViewTap () {
      const url = '/packageA/logs'
      this.$router.push(url)
    },
    getUserInfo () {
      // 调用登录接口
      wx.login({
        success: () => {
          wx.getUserInfo({
            success: (res) => {
              this.userInfo = res.userInfo
            }
          })
        }
      })
    },
    clickHandle (msg, ev) {
      console.log('clickHandle:', msg, ev)
    }
  },

  created () {
    // 调用应用实例的方法获取全局数据
    this.getUserInfo()
  }
}
</script>

<style scoped>
  .bg-all{background: #f1f1f1;}
</style>
